<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<xsl:apply-templates select="class"></xsl:apply-templates>
	</xsl:template>

	<xsl:template match="class">
	
		<xsl:if test="./@visitControl = 1">public</xsl:if>
		<xsl:if test="./@visitControl = 2">protected</xsl:if>
		<xsl:if test="./@visitControl = 3">private</xsl:if> <xsl:if test="./@isFinal"> final </xsl:if> <xsl:if test="./@isAbstract"> abstract </xsl:if>
		class {
		
			<xsl:apply-templates select="properties/property"></xsl:apply-templates>
		
		
		
		}
	</xsl:template>
	
	
	<xsl:template match="properties/property">
		<xsl:for-each select=".">
			<xsl:if test="./@visitControl = 1">public</xsl:if>
			<xsl:if test="./@visitControl = 2">protected</xsl:if>
			<xsl:if test="./@visitControl = 3">private</xsl:if>&#160; <xsl:if test="./@isFinal"> final </xsl:if>&#160; <xsl:if test="./@isAbstract"> abstract </xsl:if>
			&#160; 
			<xsl:value-of select="./@type"></xsl:value-of> &#160; 
			  <xsl:value-of select="./@name"></xsl:value-of> ;
		</xsl:for-each>
	</xsl:template>
	
	<xsl:template match="property">
		<xsl:for-each select=".">
			<xsl:if test="./@visitControl = 1">public</xsl:if>
			<xsl:if test="./@visitControl = 2">protected</xsl:if>
			<xsl:if test="./@visitControl = 3">private</xsl:if>&#160; <xsl:if test="./@isFinal"> final </xsl:if>&#160; <xsl:if test="./@isAbstract"> abstract </xsl:if>
			&#160; 
			
			<xsl:value-of select="./@type"></xsl:value-of> &#160;  
			get<xsl:value-of select="./@name"></xsl:value-of>(){
			  	
			  	return this.<xsl:value-of select="./@name"></xsl:value-of>;
			 }
			 
			 &#160;
			<xsl:if test="./@visitControl = 1">public</xsl:if>
			<xsl:if test="./@visitControl = 2">protected</xsl:if>
			<xsl:if test="./@visitControl = 3">private</xsl:if>&#160; <xsl:if test="./@isFinal"> final </xsl:if>&#160; <xsl:if test="./@isAbstract"> abstract </xsl:if>
			&#160; 
			
			void &#160;  
			set<xsl:value-of select="./@name"></xsl:value-of>(<xsl:value-of select="./@type"></xsl:value-of>&#160;<xsl:value-of select="./@name"></xsl:value-of>){
			  	
			  	 this.<xsl:value-of select="./@name"></xsl:value-of> = <xsl:value-of select="./@name"></xsl:value-of>;
			 }
		 
		</xsl:for-each>
	</xsl:template>
	
	
	<xsl:template match="properties">
	
	
		<xsl:apply-templates select="//property"></xsl:apply-templates>
	
	</xsl:template>
	
	
</xsl:stylesheet>